<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/common/common.jsp"%>
<a href="javascript:toPage(1)">首页</a>
<a href="javascript:toPage(2)">上一页</a>
<a href="javascript:toPage(3)">下一页</a>
<a href="javascript:toPage(4)">尾页</a>
当前第<input type="text" id ="pageNumber" name="pageNumber" size="1" readonly/>页
共<input type="text" id ="totalPage" name="totalPage" size="1" readonly/>页
每页<input type="text" id ="pageSize" name="pageSize" size="1" readonly/>条
共<input type="text" id ="totalCount" name="totalCount" size="1" readonly/>条
<script>
    function toPage(flag) {
        var pageNumber = parseInt($("#pageNumber").val());
        var totalPage = parseInt($("#totalPage").val());

        if (flag == 1) {//首页
            if(pageNumber <= 1){
                toastr.error("已经为首页");
                toastr.success("已经为首页");
                toastr.warning("已经为首页");
                toastr.info("已经为首页");
                return;
            }
            $("#pageNumber").val(1);
        }else if(flag == 2){//上一页
            if(pageNumber <= 1){
                alert("已经为首页");
                return;
            }
            $("#pageNumber").val(pageNumber - 1);
        }else if(flag == 3){//下一页
            if(pageNumber ==  totalPage){
                alert("已经为尾页");
                return;
            }
            $("#pageNumber").val(pageNumber + 1);
        }else if (flag == 4) {//尾页
            if(pageNumber ==  totalPage){
                alert("已经为尾页");
                return;
            }
            $("#pageNumber").val(totalPage);
        }
        login()
    }
    function install_page(page) {
        //页面分数参数赋值
        $("#pageNumber").val(page.pageNumber);
        $("#totalPage").val(page.totalPage);
        $("#pageSize").val(page.pageSize);
        $("#totalCount").val(page.totalCount);
    }
</script>
